package com.itic.mall.system.orders.item.service;

import java.util.Date;

import java.util.List;
import java.util.Map;

import com.itic.appbase.framework.type.CouponType;
import com.itic.mall.mobile.users.info.OrderItemVo;
import com.itic.mall.system.orders.item.persistence.model.OrdersItem;
import com.itic.mall.system.users.usercoupon.persistence.model.UsersCoupon;




public interface OrdersItemService {

    /**
	 * 获取订单项信息
	 * @param orderNo
	 * @param skuId
	 * @return
	 */
	public OrdersItem getOrdersItem(String orderNo, String skuId);
    public OrderItemVo getOrderItemVo(String channel, String preType, String orderNo, String skuId);
    
    /**
     * 根据订单号获取所有商品
     * @param orderNo
     * @param goodsId
     * @return
     */
    public List<OrdersItem> getOrderItemsByOrderNo(String orderNo);
    /**
     * 根据订单号和商品号获取订单详情
     * @param orderNo
     * @param goodsId
     * @return
     */
    public OrdersItem getorderItem(String orderNo,String goodsId);
    /**
     * 根据订单项传入条件查询
     * @param item
     * @return
     */
    public OrdersItem ordersItem(OrdersItem item);
    /**
     * 添加订单中的商品
     * */
    public List<OrdersItem> addOrderItem(Map<String, String> skuMap,String orderNo,String yunId,String userId) ;
    
    public Map<String, Object> calPrice(String userId,String isUserGoodCoupon,String key,int count) ;
    public double calCouponMoney(CouponType couponType, double price, UsersCoupon usersCoupon) ;
    
    public double calRefund(String orderNo,String goodId) ;
    
    public OrdersItem getOrdersItemBySpuIdAndOrderNo(String skuId,String orderNo) ;
    
    public OrdersItem   calItemCouponMoney(OrdersItem ordersItem,Double sumCouponMoney,Double actualMoney);
    /***
     * 查询超过N天的订单项
     * @return
     */
    public List<OrdersItem>  findItemsOutofDay();
    
    public void calActualOutOfDays() ;
    
    public String closeOrderItem(String orderNo,String skuId) ;
    /***
     * 获取最近购买的订单的售后的次数
     * @param userId
     * @param date
     * @return
     */
    public int getUserShoppingCountByDays(String userId,Date date) ;
    /**
     * 获取用户在友惠家的消费 以及佣金
     * @param userId
     * @param date
     * @return
     */
    public Map<String, Double> getUserYHJCommissionRateByDays(String userId,Date date);
    
    /***
     * 获取最近购买商品的佣金比例
     * @param userId
     * @param date
     * @return
     */
    public double getUserCommissionRateCountByDays(String userId,Date date) ;

    
    /***
     * 获取最近的消费钱数
     * @param userId
     * @param date
     * @return
     */
    public double getUserConsumeByDays(String userId,Date date) ;
    /**
     * 同意售后时，扣除预估收益
     * @param orderNo
     * @param skuId
     * @return
     */
    public String agreeAfterSalePreIncome(String orderNo,String skuId) ;
    
   public double getUserTotalCommission(String userId) ;
}
